<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>so8 文件系统</title>
<!--<style type="text/css">
.header{ border-top:#FFF solid 25px; background-color:#FFFFFF;border-bottom:#666666 solid 2px; padding:18px 0;}
#title{ font-family:"Times New Roman", Times, serif; font-size:36px;font-weight:bold; width:300px; }
body{margin:0;font:Verdana, Arial, Helvetica, sans-serif; font-size:14px;}
#name{font-size:36px; color:#339999;font-family:'Times New Roman', Times, serif; font-weight:bold; }
#footer{text-align:center; border-top:#CCCCCC solid 1px; margin:5px; font:"Courier New", Courier, monospace; font-size:9px;}
#menu{ background:url(img/menu.gif) repeat-x; padding:0; height:18px;}
#menu span{  float:right;}
#menu span a{text-decoration:none;color:#FF0033;font:Arial, Helvetica, sans-serif; font-size:12px; }
#topmenu{
        list-style-type: none;
        margin:0;
        padding:0;
		vertical-align:bottom;
		}
#topmenu li{
		width:100px;
		display:block;
		float:left;	
		padding:0;	
		border-right:#000066 1px solid;
		text-align:center;

		 }

#topmenu a{
		text-decoration:none;
		color:#666666;
		font-weight:bold;
		font-size:12px;			
		}

#topmenu li ul li{
		width:100px;
		height:20px;
		}
#topmenu li ul{
		list-style-type:circle;
		position:absolute;
		left:-999em;
		padding:0;
		background-color:#ff9933; 
		}
#topmenu li:hover ul{
		position:absolute;
		padding:0;
		background-color:#ff9933; 
		}
#topmenu li:hover ul li:hover{
		background-color:#999; 
		}
#content{
text-align:left;
margin-top:20px;
}		
		
-->
<!--</style>
<script  type="text/javascript">

// hasClass
function hasClass(ele,cls)
{
	return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));

}
function removeClass(ele,cls)
{
	if(hasClass(ele,cls))
		{
		var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
			ele.className=ele.className.replace(reg,'');
		}
}
function addClass(ele,cls)
{
	if(!hasClass(ele,cls))
		ele.className+=" "+cls;
}
function setUlPos()
{
var newleft = this.offsetLeft;
var oUl = this.getElementsByTagName('ul')[0];
 oUl.style.left = newleft + 'px';


}
function resetUlPos()
{
var oUl = this.getElementsByTagName('ul')[0];
 oUl.style.left = '-999em';
}

function initMenu()
{
	var Lis=document.getElementById("topmenu").getElementsByTagName('li');
	
	for (var j=0;j<Lis.length;j++)
	{
		if(Lis[j].getElementsByTagName("ul").length>0) //避免事件绑定到底层li标签
		{
				Lis[j].onmouseover=setUlPos;
				Lis[j].onmouseout=resetUlPos;
		}
	}
}

window.onload=initMenu;

</script>-->
</head>

<body>

<!--<div style="width:960px; margin:0 auto">
<div class="header" >
<table width="960"  cellpadding="0" cellspacing="0" >
  <tr>
<td width="323"><span id="name">Document Sharing</span></td>
<td width="635" style="text-align:right; vertical-align:center;">
<form>
<input style="width:200px; height:25px; margin:0; border:#66CC33 solid 1px; color:#333333; font:'Times New Roman', Times, serif; font-size:18px;" type="text" name="key" value=""/>
<input style="background:#999999; height:28px; color:#FFFFFF; border-bottom:#0099FF solid 1px; margin-left:-4px; margin-right:30px; vertical-align:bottom " type="button" value="search"/></form>
</td>
 </tr></table>
</div>
<div id="menu"><ul  id="topmenu"><li  ><a href="#">ALL </a><ul><li><a href="#">a</a></li><li><a href="#">b</a></li><li><a href="#">c</a></li></ul></li><li  ><a href="#">SO8 ></a><ul><li><a href="#">aa</a></li><li><a href="#">bb</a></li><li><a href="#">cc</a></li><li><a href="#">cc</a></li><li><a href="#">cc</a></li></ul></li><li ><a href="#">TSSOP ></a><ul><li><a href="#">a</a></li><li><a href="#">b</a></li><li><a href="#">c</a></li></ul></li><li ><a href="#">DIPS ></a></li></ul><span><a href="upload.php#add#new">增加共享</a></span></div>-->
<div id="content">
<?php

//session_start();
$dir = "./files/";
require_once("dbase.php");
$db=new dbase();
$arr = $db->getdata("`status` = 'active'");

//$arr = scandir($dir);
//array_shift($arr);
//array_shift($arr);
//sort($arr);
$id = 23;
//print_r($arr);


?>


<table width="100%%" border="1" cellpadding="1" cellspacing="0" style="border-collapse:collapse;">
  <?php
  foreach($arr as $key => $v)
{


	
	  $id = $v['id'];
	  $file = $v['file_name'];
	  $ext =  $v['extension'];
	  $src = $dir.$v['url'];
	  $clicks =$v['clicks'];
	  $time =$v['date_time'];
	  $img = "./img/";
	  switch(strtolower($ext))
	  {
	  case 'xls': $img.="xls";break;
	  case 'pdf': $img.="pdf";break;
	  case 'ppt': $img.="ppt";break;
	  case 'txt': $img.="txt";break;
	  case 'doc': $img.="doc";break;
	  case 'xls': $img.="xls";break;
	  //case 'png': $img.="png";break;
	  default: $img.="unknown";break;
	  }
	  $img.=".PNG";
	//  echo $img;
	//  echo $file."<br />  ";13590355872
	 // $src = $dir.$val;
	 
	  ?>
	  <tr>
		<td width="1%"><img src="<?php echo $img?>"/></td>
		<td width="77%" ><a  href="<? echo $src?>" target="_blank"><strong><?php echo $file?></strong></a></td>
		<td width="12%"><?php echo  $time?></td>
		<td width="5%"><a href="delete.php#<?php echo $file."#".$id?>" target="content">删除</a></td>
		<td width="5%" ><a href="upload.php#<?php echo $file."#".$id?>" target="content">更新</a></td>
	  </tr>
	  <?php

  }
  ?>
</table>
</div>
<!--<div id="footer">
©2011 E-solution Team
</div>-->
</div>

</body>
</html>
